package com.lmscn.lms.api.model;

import com.jfinal.plugin.activerecord.Model;

import java.util.List;

/**
 * Created by quxingyu on 2015/8/6.
 */
public class QuestionCategory extends Model<QuestionCategory> {
    public static final QuestionCategory dao = new QuestionCategory();
    
    /**
     * 获取所有的题库分类
     * */
    public List<QuestionCategory> getQuestionCategory() {
        return dao.find("select * from t_question_category");
    }
    /**
     * 获取指定分类之外的所有题库分类
     * */
    public List getOtherQuestionCategory(String categoryIds){
        return dao.find("select * from t_question_category where id not in (?)",categoryIds);
    }

    public QuestionCategory getQuestionCategory(Long id,String type){
        return dao.findFirst("select * from t_question_category where target_id = ? and target_type = ?",id,type);
    }
  }
